﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Demo.Services.Services.Impl.Managers;
using Ext.Net;
using Demo.CommonBase.Logging;
using Demo.CommonBase.Exceptions;
using System.Reflection;
using Demo.Services.Contracts.DTO.Infos;

namespace Demo.Web.Grafics
{
    public partial class ProyectGraficView : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                GetProjectStatus();
            }

        }


        protected void GetProjectStatus()
        {

            ProyectManager proyectManager;
            List<ProjectReportInfo> proyects;
                try
                {
                    Logger.Info();
                    proyectManager = new ProyectManager();
                    proyects = proyectManager.GetProjectStatus();
                    var store = Chart1.GetStore();
                    store.DataSource = proyects;
                    store.DataBind();
                    Chart1.DataBind();
                }
                catch (Exception ex)
                {
                    Logger.Error(ex);
                    throw new UnhandledException(MethodInfo.GetCurrentMethod(), ex);
                }

            
        }     

    }
}